#ifndef _PATTERN_MANAGER_H_
# define _PATTERN_MANAGER_H_

# include <list>
# include "Board.h"
# include "PatternFileManager.h"

struct pattern
{
	char***	Form;
	int		TotalPositions;
	int		Size; // Total size for width and height

	pattern();
	~pattern();

private:
	pattern(pattern const&);
	pattern& operator=(pattern const&);
};

class PatternManager
{
private:
	static PatternManager& m_instance;
	std::list<pattern*> m_patterns;

protected:
	PatternManager();
	~PatternManager();

public:
	static PatternManager& Instance();
	void InitPattern(pattern*& _p, int _totalPositions, int _size);
	bool CheckPattern(pattern* _p, int _x, int _y, BoardCase _color, Board& _board, bool _verbose = false);
	std::list<pattern*> const& GetPatterns() const;

	__declspec(property(get=GetPatterns))std::list<pattern*> const& Patterns;

private:
	PatternManager(PatternManager const&);
	PatternManager& operator=(PatternManager const&);
};

#endif // _PATTERN_MANAGER_H_
